package org.jeecg.modules.stoneentry.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.stoneentry.entity.StoneEntry;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * @Description:  石出入库
 * @Author: jerryzhu
 * @Date:   2021-11-15
 * @Version: V1.0
 */
public interface StoneEntryMapper extends BaseMapper<StoneEntry> {
	
	/**查询金出入库数据明细分页*/
	IPage<StoneEntry> selectStoneEntryPage(Page<StoneEntry> page, @Param(Constants.WRAPPER) Wrapper<StoneEntry> queryWrapper);

	/**查询仓库库存数据列表，不分页*/
	List<StoneEntry> getStoneEntryStorageSummaryList(@Param("storageId") String storageId);
	
	/**查询员工库存数据列表，不分页*/
	List<StoneEntry> getStoneEntryPersonSummaryList(@Param("userName") String userName);
	
	/**根据成色ID获取折足率*/
	@Select("select stone_content from stone_karat where id = #{karat}")
	String getStoneContentByKaratId(@Param("karat") String karat);

	/**根据ID获取仓库名字*/
	@Select("select name from stone_storage where id = #{id}")
	String getStorageName(@Param("id") String id);

	/**通过石卡号获取石卡信息*/
	@Select("select * from stone_entry where code_num = #{codeNum}")
	Map<String, String> queryStoneCardInfoByCodeNum(@Param("codeNum") String codeNum);
	
	/**通过石号获取石号信息*/
	@Select("select * from stone_style where code_num = #{stoneNum}")
	Map<String, String> queryStoneStyleByStoneNum(@Param("stoneNum") String stoneNum);
}
